import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:mobile_vpn/common/cpn/cpn_view_state.dart';
import 'package:mobile_vpn/pages/set_up/set_logic.dart';
import '../../common/cpn/sliver_app_bar.dart';
import '../../theme/color_palettes.dart';

class AboutPage extends CpnViewState<SetLogic> {

  AboutPage({Key? key}) : super(key: key, bindViewState: false);
  @override
  Widget buildBody(BuildContext context) {
    return CustomScrollView(
      slivers: [
        commonSliverAppBar(
          title: '关于我们',
        ),
        SliverToBoxAdapter(
          child: Padding(
            padding: EdgeInsets.all(20.w),
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Center(
                  child: Text(
                    '快连VPN',
                    style: TextStyle(
                      fontSize: 28,
                      fontWeight: FontWeight.bold,
                      color: ColorPalettes.instance.firstText,
                    ),
                  ),
                ),
                SizedBox(height: 20.h),
                Text(
                  '连接世界，畅享自由',
                  style: TextStyle(
                    fontSize: 20,
                    fontWeight: FontWeight.w500,
                    color: ColorPalettes.instance.firstText,
                  ),
                ),
                const SizedBox(height: 20),
                Text(
                  '快连VPN致力于为用户提供安全、稳定、高速的网络连接服务，帮助用户突破地域限制，畅享体验。',
                  style: TextStyle(
                    fontSize: 16,
                    color: ColorPalettes.instance.firstText,
                  ),
                ),
                const SizedBox(height: 30),
                Text(
                  '我们的优势',
                  style: TextStyle(
                    fontSize: 22,
                    fontWeight: FontWeight.bold,
                    color: ColorPalettes.instance.firstText,
                  ),
                ),
                SizedBox(height: 10.h),
                _buildFeatureItem('全球覆盖', '拥有遍布全球的服务器节点，用户可轻松连接至任何地区。'),
                _buildFeatureItem('军用级加密', '采用业界领先的加密技术，确保用户数据传输安全。'),
                _buildFeatureItem('极速连接', '智能路由优化技术，提供稳定流畅的网络体验。'),
                _buildFeatureItem('简单易用', '一键连接，无需复杂设置，轻松开启自由网络之旅。'),
                _buildFeatureItem('多平台支持', '支持Windows、Mac、iOS、Android等多种设备。'),
                SizedBox(height: 30.h),
                Text(
                  '我们的使命',
                  style: TextStyle(
                    fontSize: 22,
                    fontWeight: FontWeight.bold,
                    color: ColorPalettes.instance.firstText,
                  ),
                ),
                SizedBox(height: 10.h),
                Text(
                  '我们相信，互联网应该是自由、开放、无界的。快连VPN将持续为用户提供优质的网络服务，帮助用户突破限制，连接世界，探索无限可能。',
                  style: TextStyle(
                    fontSize: 16,
                    color: ColorPalettes.instance.firstText,
                  ),
                ),
                SizedBox(height: 30.h),
                Text(
                  '联系我们',
                  style: TextStyle(
                    fontSize: 22,
                    fontWeight: FontWeight.bold,
                    color: ColorPalettes.instance.firstText,
                  ),
                ),
                SizedBox(height: 10.h),
                _buildContactItem('官方网站', 'https://www.kuailianvpn.com'),
                _buildContactItem('客服邮箱', 'support@kuailianvpn.com'),
                _buildContactItem('客服电话', '400-123-4567'),
                SizedBox(height: 30.h),
                Center(
                  child: Text(
                    '© 2025 快连VPN 版权所有',
                    style: TextStyle(
                      fontSize: 14,
                      color: ColorPalettes.instance.firstText,
                    ),
                  ),
                ),
              ],
            ),
          ),
        ),
      ],
    );
  }

  Widget _buildFeatureItem(String title, String description) {
    return Padding(
      padding: EdgeInsets.only(bottom: 15.h),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.center,
        crossAxisAlignment: CrossAxisAlignment.center,
        children: [
          Icon(Icons.check_circle, color: ColorPalettes.instance.firstIcon, size: 20.r),
          SizedBox(width: 10.w),
          Expanded(
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Text(
                  title,
                  style: TextStyle(
                    fontSize: 18,
                    fontWeight: FontWeight.w500,
                    color: ColorPalettes.instance.firstText,
                  ),
                ),
                Text(
                  description,
                  style: TextStyle(
                    fontSize: 14,
                    color: ColorPalettes.instance.firstText,
                  ),
                ),
              ],
            ),
          ),
        ],
      ),
    );
  }

  Widget _buildContactItem(String label, String value) {
    return Padding(
      padding: EdgeInsets.only(bottom: 10.h),
      child: Row(
        children: [
          Text(
            '$label: ',
            style: TextStyle(
              fontSize: 16,
              fontWeight: FontWeight.w500,
              color: ColorPalettes.instance.firstText,
            ),
          ),
          Text(
            value,
            style: TextStyle(
              fontSize: 16,
              color: ColorPalettes.instance.firstText,
            ),
          ),
        ],
      ),
    );
  }
}


